package com.zzxx.mapper;

import com.zzxx.entity.TicketNum;
import com.zzxx.entity.TicketNumExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface TicketNumMapper {
    @SelectProvider(type=TicketNumSqlProvider.class, method="countByExample")
    long countByExample(TicketNumExample example);

    @DeleteProvider(type=TicketNumSqlProvider.class, method="deleteByExample")
    int deleteByExample(TicketNumExample example);

    @Delete({
        "delete from ticketnum",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    @Insert({
        "insert into ticketnum (id, tid, ",
        "date, num)",
        "values (#{id,jdbcType=VARCHAR}, #{tid,jdbcType=VARCHAR}, ",
        "#{date,jdbcType=DATE}, #{num,jdbcType=INTEGER})"
    })
    int insert(TicketNum row);

    @InsertProvider(type=TicketNumSqlProvider.class, method="insertSelective")
    int insertSelective(TicketNum row);

    @SelectProvider(type=TicketNumSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="tid", property="tid", jdbcType=JdbcType.VARCHAR),
        @Result(column="date", property="date", jdbcType=JdbcType.DATE),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER)
    })
    List<TicketNum> selectByExample(TicketNumExample example);

    @Select({
        "select",
        "id, tid, date, num",
        "from ticketnum",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="tid", property="tid", jdbcType=JdbcType.VARCHAR),
        @Result(column="date", property="date", jdbcType=JdbcType.DATE),
        @Result(column="num", property="num", jdbcType=JdbcType.INTEGER)
    })
    TicketNum selectByPrimaryKey(String id);

    @UpdateProvider(type=TicketNumSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") TicketNum row, @Param("example") TicketNumExample example);

    @UpdateProvider(type=TicketNumSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") TicketNum row, @Param("example") TicketNumExample example);

    @UpdateProvider(type=TicketNumSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(TicketNum row);

    @Update({
        "update ticketnum",
        "set tid = #{tid,jdbcType=VARCHAR},",
          "date = #{date,jdbcType=DATE},",
          "num = #{num,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(TicketNum row);
}